<template>
  <div id="app">
    <h2>微应用1</h2>
    主应用菜单状态：{{statu?'展开':'收起'}}
    <br>
    <input type="text" v-model="value" @blur="valChange">
    <br>
    跨应用输入值：{{value}}
    <br>
    <img alt="Vue logo" src="./assets/logo.png">
    <br>
    <button @click="toggleMenu">toggle menu</button>
    <!-- <hello-world/> -->
  </div>
</template>

<script>
import HelloWorld from './components/HelloWorld.vue'

export default {
  name: 'App',
  components: {
    HelloWorld
  },
  data(){
    return {
      statu: false,
      value: ''
    }
  },
  mounted(){
    this.$actionChange((state)=>{
      this.statu = state.demo; 
      this.value = state.value;
    })
  },
  methods:{
    valChange(){
      this.$setAction({value: this.value})
    },
    toggleMenu(){
      this.statu = !this.statu;
      this.$setAction({demo: this.statu})

    }
  }
}
</script>

<style>
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
}
</style>
